package com.example.sysao.service.impl;

import com.example.sysao.mapper.MaintenanceMapper;
import com.example.sysao.pejo.Maintenance;
import com.example.sysao.service.MaintenanceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MaintenanceServiceImp implements MaintenanceService {
    @Resource
    private MaintenanceMapper maintenanceMapper;

    @Override
    public boolean addMaintenance(Maintenance maintenance) {
        return maintenanceMapper.inserMaintenance(maintenance) != 0;
    }

    @Override
    public List<Maintenance> findAll() {
        return maintenanceMapper.selectAll();
    }

    @Override
    public boolean removeMaintence(int id) {
        return maintenanceMapper.deliteById(id) != 0;
    }

    @Override
    public boolean removeMaintencebyRid(int repairid) {
        return maintenanceMapper.deleteByRid(repairid) != 0;
    }
}
